import request from '@/utils/request'

// 查询入库作业列表
export function listTask(query) {
  return request({
    url: '/enterwarehouse/enter/list',
    method: 'get',
    params: query
  })
}

// 查询入库作业详细
export function getTask(enterWarehouseId) {
  return request({
    url: '/enterwarehouse/enter/' + enterWarehouseId,
    method: 'get'
  })
}

// 新增入库作业
export function addTask(data) {
  return request({
    url: '/enterwarehouse/enter',
    method: 'post',
    data: data
  })
}

// 修改入库作业
export function updateTask(data) {
  return request({
    url: '/enterwarehouse/enter',
    method: 'put',
    data: data
  })
}

// 删除入库作业
export function delTask(enterWarehouseId) {
  return request({
    url: '/enterwarehouse/enter/' + enterWarehouseId,
    method: 'delete'
  })
}

// 修改入库状态
export function confirmEnterWarehouse(data) {
  return request({
    url: '/enterwarehouse/enter/confirm',
    method: 'put',
    data: data
  })
}

// 查询重量
export function getEnterWeightSum(query) {
  return request({
    url: '/enterwarehouse/enter/enterweightsum',
    method: 'get',
    params: query
  })
}

// 新增货物信息
export function addGood(data) {
  return request({
    url: '/enterwarehouse/enter/ext',
    method: 'post',
    data: data
  })
}

// 修改货物信息
export function updateGood(data) {
  return request({
    url: '/enterwarehouse/enter/ext',
    method: 'put',
    data: data
  })
}

// 物理删除货物信息
export function delGoodExt(goodsIds, number) {
  return request({
    url: '/enterwarehouse/enter/ext/' + goodsIds + '/' + number,
    method: 'delete'
  })
}
